using System.IO;
using Unity.Collections;
using UnityEngine;

namespace Framework
{
    public interface IAssetProcessor
    {
        /// <summary>
        /// 资源信息
        /// </summary>
        /// <param name="value"></param>
        void InitAssetsInfo(AssetsInfo value);
        /// <summary>
        /// 处理加载资源
        /// </summary>
        /// <param name="target">加载完的资源</param>
        /// <param name="path">加载路径</param>
        void ProcessAsset(object target, string path);
        
        /// <summary>
        /// 获取文件流
        /// </summary>
        /// <param name="path">文件路径</param>
        /// <returns>文件流</returns>
        MemoryStream GetFile(string path);
        /// <summary>
        /// 解密bundle文件
        /// 此文件流需先缓存，然后再UnloadBundle文件里销毁
        /// </summary>
        /// <param name="path">文件路径</param>
        /// <param name="dataBuffer">文件内容buffer</param>
        /// <param name="length">文件大小</param>
        /// <param name="offset">文件索引位置</param>
        /// <returns>文件流</returns>
        MemoryStream ProcessFile(string path, byte[] dataBuffer, int length,int offset);
        void ProcessFile(byte[] dataBuffer);
        /// <summary>
        /// 加载bundle
        /// </summary>
        /// <param name="value"></param>
        /// <param name="path"></param>
        void OnLoadBundle(AssetBundle value, string path);
        /// <summary>
        /// 不卸载资源
        /// </summary>
        /// <param name="path">bundle路径</param>
        /// <returns>不卸载</returns>
        bool DontUnloadBundle(string path);
        /// <summary>
        /// 卸载bundle
        /// </summary>
        /// <param name="path"></param>
        void OnUnloadBundle(string path);


    }
}